const indexRouters = require('./routes/index')
const apiRouter = require('./routes/apis')
const testRouter = require('./routes/test')
// test
// const homeRouter = require('./routes/api/islogin')

function UseRouter(app) {
  if (!app) return

  app.use('/test', testRouter)

  // 例如，完整路由  --get-- http://localhost:3000/api/islogin
  app.use('/api', indexRouters)
  app.use('/api', apiRouter) // 而这里 从 `http://localhost:3000/api` 后面开始

  // 例如，完整路由  --get-- http://localhost:3000/app/islogin
  // app.use('/app', indexRouters)
  // app.use('/app', apiRouter)

  // test
  // app.use('/api', homeRouter)
}

module.exports = UseRouter